/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package smallcms.usermgt;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import smallcms.entity.User;

/**
 *
 * @author hr1ur093
 */
@Stateless
public class UserBean {

    @PersistenceContext(unitName = "smallcmsPU")
    EntityManager em;  

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

    public void createUser(User user) {
        //em.merge(user);
        em.persist(user);
    }
        
    public void editUser(User user) {
        em.merge(user);
    }
    
    public void deleteUser(User user) {
        em.remove(user);
    }
}
